package com.loukou.lkt.lkt.enums;

/**
 * type：
	(1)采购进货，直接加库存		上面的num就是新增的数量
	(2)采购退货，直接减库存		上面的num就是减去的数量
	(3)销售订单，减去库存、减去冻结		上面的num就是变化的数量
	(4)库存盘点，更新库存			上面的num就是需要更新成的数量
	(5)调拨入库					增加库存
	(6)调拨出库					减去库存
 * @author 荣
 *
 */
public enum ChangeStockTypeEnum {

	TYPE_UNKNOWN( -1, "" ),
	
	TYPE_PURCHASE_IN( 1, "采购入库" ),
	
	TYPE_RETURN_OUT( 2, "退货出库" ),
	
	TYPE_SELL_OUT( 3, "销售出库" ),
	
	TYPE_CHECK_UPDATE( 4, "盘点更新" ),
	
	TYPE_ALLOCATION_IN( 5, "调拨入库" ),
	
	TYPE_ALLOCATION_OUT( 6, "调拨出库" );
	
	private int type;
	private String comment;
	
	ChangeStockTypeEnum( int type, String comment) {
		this.type = type;
		this.comment = comment;
	}
	
	public static ChangeStockTypeEnum parseType(int type) {
		for (ChangeStockTypeEnum e : ChangeStockTypeEnum.values()) {
			if (e.type == type) {
				return e;
			}
		}
		return TYPE_UNKNOWN;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public String getComment() {
		return comment;
	}
	public void setComment(String comment) {
		this.comment = comment;
	}
}
